//
//  TernaryBootcamp.swift
//  FCSwiftUI
//
//  Created by 冯宣超 on 2023/2/22.
//

import SwiftUI

struct TernaryBootcamp: View {
    
    @State var isStartingState: Bool = true
    
    var body: some View {
        VStack {
            Text(isStartingState ? "STARTING STATE" : "ENDING STATE")
                .padding()
            
            Button("Button") {
                isStartingState.toggle()
            }
            
            RoundedRectangle(cornerRadius: 25.0)
                .fill(isStartingState ? Color.red : Color.blue)
                .frame(width: 200, height: 100)
        }
    }
}

struct TernaryBootcamp_Previews: PreviewProvider {
    static var previews: some View {
        TernaryBootcamp()
    }
}
